package main;

import java.awt.*;
import java.util.ArrayList;
import java.util.List;

public class Zombie extends LivingEntity {

    public Zombie(Image left,Image stepLeft, Image right, Image stepRight, Image stay) {
        super(left, stepLeft, right, stepRight, stay, 64, 64);
        boxWidth = 16;
        boxHeight = 32;

    }






    @Override
    public void update() {
        super.update();



//        if ((256 <= randomX && randomX <= max && 256 <= randomY && randomY <= -128)
//                /*|| (128 <= randomX && randomX <= 256 && 128 <= randomY && randomY <= 256)*/) {
        toPosX = Register.PLAYER.posX;
        toPosY = Register.PLAYER.posY;
//
        if (locateIn(128, Register.PLAYER))
            flagToPlayer = true;


        if ( flagToPlayer ) {

            if ( preyPosX(Register.PLAYER) == posX && preyPosY(Register.PLAYER) == posY )
                flagToPlayer = false;
            goTo(toPosX, toPosY);

        } else {

            walk(Game.random.nextInt(100) == 0);

        }



    }



}
